//
//  CatogryGiftMainCollectionViewCell.m
//  project
//
//  Created by lanou on 15/10/29.
//  Copyright © 2015年 lanou. All rights reserved.
//

#import "CatogryGiftMainCollectionViewCell.h"
#import <UIImageView+WebCache.h>

@implementation CatogryGiftMainCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self)
    {
        _giftImageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, (kWidth - 130) / 3, (kWidth - 130) / 3)];
        _giftImageView.backgroundColor = [UIColor whiteColor];
        [self.contentView addSubview:_giftImageView];
        
        _giftLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, (kWidth - 130) / 3 , (kWidth - 130) / 3, 20)];
        _giftLabel.font = [UIFont systemFontOfSize:12];
        _giftLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:_giftLabel];
    }
    return self;
}

-(void)setModel:(CatogryMainCollectionModel *)model
{
    _model = model;
    [_giftImageView sd_setImageWithURL:[NSURL URLWithString:model.icon_url]];
    _giftLabel.text = model.name;
}

@end
